package com.blockchain.securewallet.tools;

import com.blockchain.securewallet.WalletApp;

import java.math.BigDecimal;

/**
 * Created by Lopez on 2018/6/13.
 */
public class WalletTools {

    //获取用户自定义的手续费 ------ 比特币    //注意没有乘以1000
    public static String getUserBTCFee() {
        long btcUserFee = WalletApp.getInstance().getUserBitCoinFee();
        BigDecimal btcUserBig = BigDecimal.valueOf(btcUserFee).divide(BigDecimal.valueOf(100_000_000));
        String btc = btcUserBig.toString();
        String fee = btcUserBig.toPlainString();
        //Logger.ds("btc fee: " + fee + "\t\t> btc toString: " + btc);
        return fee;
    }


    //获取用户自定义的手续费 ------ 莱特币    //注意没有乘以1000
    public static String getUserLTCFee() {
        long ltcUserFee = WalletApp.getInstance().getUserLtcFee();
        BigDecimal ltcUserBig = BigDecimal.valueOf(ltcUserFee).divide(BigDecimal.valueOf(100_000_000));
        String btc = ltcUserBig.toString();
        String fee = ltcUserBig.toPlainString();
        //Logger.ds("btc fee: " + fee + "\t\t> btc toString: " + btc);
        return fee;
    }

    //获取用户自定义的手续费 ------ 比特现金    //注意没有乘以1000
    public static String getUserBCHFee() {
        long bchUserFee = WalletApp.getInstance().getUserBchFee();
        BigDecimal ltcUserBig = BigDecimal.valueOf(bchUserFee).divide(BigDecimal.valueOf(100_000_000));
        String btc = ltcUserBig.toString();
        String fee = ltcUserBig.toPlainString();
        //Logger.ds("btc fee: " + fee + "\t\t> btc toString: " + btc);
        return fee;
    }



    //获取用户自定义的手续费 ------ 以太坊
    public static String getUserETHFee() {
        long ethUserFee = WalletApp.getInstance().getUserGasPrice();
        String fee = BigDecimal.valueOf(ethUserFee).toString();
        return fee;
    }


    //获取自定义的 ETH Gas Limit ------ 以太坊
    public static String getETHGasLimit() {
        long userGasLimit = WalletApp.getInstance().getUserGasLimit();
        String limit = BigDecimal.valueOf(userGasLimit).toString();
        return limit;
    }

    //获取自定义的 ETH Gas Nonce ------ 以太坊
    public static String getETHNonce() {
        long userNonce = WalletApp.getInstance().getUserNonce();
        String nonce = BigDecimal.valueOf(userNonce).toString();
        // Logger.ds(">> 目前自定义的 nonce: " + nonce);
        return nonce;
    }


}
